package com.zzl.study.demo.domain;

import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.Id;
import jakarta.persistence.Table;
import lombok.Data;

/**
 * 诗词实体对象
 *
 * @author: zhangzl
 * @date: 2025/10/13 15:08
 * @version: 1.0
 */
@Data
@Entity
@Table(name = "poems")
public class Poem {

    /**
     * 主键ID
     */
    @Id
    private Integer id;

    /**
     * 标题
     */
    @Column(name = "title")
    private String title;

    /**
     * 作者
     */
    @Column(name = "author")
    private String author;

    /**
     * 内容
     */
    @Column(name = "content")
    private String content;

    /**
     * 标签
     */
    @Column(name = "tags")
    private String tags;

    @Override
    public String toString() {
        return String.format("""
                %s
                %s
                %s
                """, this.title, this.author, this.content);
    }

}
